var request=require("../utils/api.js").request
//接口的api
//登陆 存openid
export function postDoLogin(data){
  return request({
    url:"/dologin",
    method:'post',
    data
  })
}
//获取openid
export function postOpenid(data){
  return request({
    url:'/getOpenid',
    method:'post',
    data
  })
}

//banner
export function getBanner(){
  return request({
    url:'/Banner',
    method:'get'
  })
}
/**
 ** 点餐页 
 */
//分类
export function getCategory(){
  return request({
    url:'/Category',
    method:'get'
  })
}
//商品列表 传id
export function getProduct(id){
  return request({
    url:'/Product/'+id,
    method:'get'
  })
}
//购物车列表
export function getCart(){
  return request({
    url:'/Cart',
    method:'get'
  })
}
//添加购物车 +1
export function postAddCart(data){
  return request({
    url:'/AddCart',
    method:'post',
    data
  })
}
//购物车 商品-1
export function postReduceCart(data){
  return request({
    url:'/ReduceCart',
    method:'post',
    data
  })
}
//清空购物车 传cartid
export function postCartDel(data){
  return request({
    url:'/CartDel',
    method:'post',
    data
  })
}
// 产品详情
export function getProductInfo(id){
  return request({
    url:'/ProductInfo/'+id,
    method:'get'
  })
}
//产品搭配方式
export function getDapei(){
  return request({
    url:'/Dapei',
    method:'get'
  })
}
// 自选菜单  自选菜单 商品列表
export function getProductDapei(){
  return request({
    url:'/ProductDapei',
    method:'get'
  })
}
// 自选菜单 +
export function postDapeiAddCart(data){
  return request({
    url:'/DapeiAddCart',
    method:'post',
    data
  })
}
// 自选菜单 -
export function postDapeiReduceCart(data){
  return request({
    url:'/DapeiReduceCart',
    method:'post',
    data
  })
}
// 生成套餐
export function postXuniProduct(data){
  return request({
    url:'/XuniProduct',
    method:'post',
    data
  })
}
/*
***用户信息
*/
//我的
export function getUserInfo(){
  return request({
    url:'/UserInfo',
    method:'get'
  })
}
//消费记录
export function getUserLog(){
  return request({
    url:'/UserLog',
    method:'get'
  })
}
//我的钱包
export function getUserBalance(){
  return request({
    url:'/UserBalance',
    method:'get'
  })
}
//充值规则
export function getRecharge(){
  return request({
    url:'/Recharge',
    method:'get'
  })
}
//优惠卷列表
export function getUserPrefer(){
  return request({
    url:'/UserPrefer',
    method:'get'
  })
}


/*
***收货地址
*/
//列表
export function getAddress(){
  return request({
    url:'/Address',
    method:'get'
  })
}
//删除
export function getAddressDel(id){
  return request({
    url:'/AddressDel/'+id,
    method:'get'
  })
}
//详情修改
export function getAddressEdit(id){
  return request({
    url:'/AddressEdit/'+id,
    method:'get'
  })
}
//保存
export function postAddressAdd(data){
  return request({
    url:'/AddressAdd',
    method:'post',
    data
  })
}
//详情提交
export function postAddressUpdate(data){
  return request({
    url:'/AddressUpdate',
    method:'post',
    data
  })
}
//经纬度定位
export function getRestaurantAddress(){
  return request({
    url:'/RestaurantAddress',
    method:'get'
  })
}
/*
***订单
*/
//创建订单
export function postOrderCreate(data){
  return request({
    url:'/OrderCreate',
    method:'post',
    data
  })
}
//订单详情  
export function getUserOrderInfo(id){
  return request({
    url:'/UserOrderInfo/'+id,
    method:'get'
  })
}
//用户订单  全部订单不传 未支付1    已支付2
export function postUserOrder(data){
  return request({
    url:'/UserOrder',
    method:'post',
    data
  })
}
//支付
export function postPay(data){
  return request({
    url:'/pay',
    method:'post',
    data
  })
}
//更新提交订单
export function postOrderUpdate(data){
  return request({
    url:'/OrderUpdate',
    method:'post',
    data
  })
}

/*
***联系我们
*/
export function getContact(){
  return request({
    url:'/Contact',
    method:'get'
  })
}



//支付成功
export function getCountOrder(){
  return request({
    url:'/CountOrder',
    method:'get'
  })
}
//订单打印
export function posPrintMsg(data){
  return request({
    url:'/printMsg',
    method:'post',
    data
  })
}

//支付测试
export function postPayJuhe(data){
  return request({
    url:'/payJuhe',
    method:'post',
    data
  })
}

//取消订单
export function postOrderQx(data){
  return request({
    url:'/OrderQx',
    method:'post',
    data
  })
}
